using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace OrderingSystem.Core.Entities
{
    /// <summary>
    /// 管理员用户实体类，映射到 users 表
    /// </summary>
    [Table("users")]
    public class Admin
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        [Column("id")]
        public long Id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("addtime")]
        public DateTime AddTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 用户名
        /// </summary>
        [Required]
        [Column("username")]
        public string Username { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Required]
        [Column("password")]
        public string Password { get; set; }

        /// <summary>
        /// 角色
        /// </summary>
        [Column("role")]
        public string Role { get; set; } = "管理员";
    }
} 